#light
namespace Langexplr.Abc


module Utils = begin

 let rec MultiPartition' aList (p:'a -> 'a -> bool) results = 
    match aList with
    | x::rest -> 
           let equivalent,newRest =
                  List.partition
                        (fun e -> p x e)
                        rest
             in MultiPartition' newRest p ((x::equivalent)::results)
    | [] -> results

 let  MultiPartition  (p:'a -> 'a -> bool) aList = 
      MultiPartition' aList p []


end
